import sys




def print_log(cmd, user_id):
    file_path = "C:\\Users\\Administrator\\Desktop\\金色财经\\im-chat-message.log.bak"  # 替换为实际文件路径

    # 打开文件并读取内容
    with open(file_path, "r") as file:
        content = file.read()

    # 根据换行符分割成字符串数组
    lines = content.split("\n")

    # 打印每行数据
    for line in lines:
        if "receive" in line and cmd in line:
            # 1
            lines_t = line.split("\t")
            print(line)
            for line_t in lines_t:
                print(line_t)

# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    if len(sys.argv) != 3:
        print("Usage: python script.py <cmd_type> <userid>")
        sys.exit(1)

    cmd_type = sys.argv[1]
    user_id = sys.argv[2]
    print_log(cmd_type, user_id)
